import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
	server: {
		host: true, // 监听所有地址
		// 代理
		proxy: {
			'/c-api/': {
                target: 'http://localhost:8080',
                changeOrigin: true,
                ws: false,
            }
		},
	},
	css: {
		preprocessorOptions: {
			scss: {
				additionalData: '@import "/src/console/assets/css/reset.scss";'
			}
		}
	},
    build: {
        rollupOptions: {  // 自定义底层的 Rollup 打包配置
            input: {
                index: path.resolve(__dirname, 'index.html'),
                console: path.resolve(__dirname, 'console.html'),
            }, 
        },
    },
    plugins: [vue()],
})
